package com.feri.api.controller;

import com.feri.api.service.intf.TypeService;
import com.feri.api.vo.R;
import com.feri.common.entity.Type;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @autor wfl
 * @time 2022/10/4
 */
@RestController
@CrossOrigin
@Api(tags = "商品类型相关操作")
@RequestMapping("/api/type/")
public class TypeController {
    @Autowired
    private TypeService service;
    @PostMapping("save.do")
    public R save(String name){
        return service.save(name);
    }
    @GetMapping("delete.do")
    public R delete(long id){
        return service.delete(id);
    }
    @GetMapping("query.do")
    public R query(){
        return service.QueryList();
    }
    @PostMapping("update.do")
    public R update(Type type){
        return service.update(type);
    }
}
